<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: soft01
  Date: 20-10-13
  Time: 上午11:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>员工信息列表</title>
</head>
<body>
<h1>员工信息清单</h1>
<a href="${pageContext.request.contextPath}/addemp.jsp">返回添加员工页</a>
<table border="1">
    <tr>
        <th>编号</th>
        <th>姓名</th>
        <th>工资</th>
        <th>性别</th>
        <th>学历</th>
        <th>爱好</th>
        <th>操作</th>
    </tr>
    <c:forEach items="${emplist}" var="emp" varStatus="i">
    <tr>
        <td>${i.index+1}</td>
        <td>${emp.name}</td>
        <td>${emp.salary}</td>
        <td>${emp.gender}</td>
        <td>${emp.edu}</td>
        <td>
            <c:forEach items="${emp.hobbies}" var="hobby" varStatus="s">
                <c:if test="${not s.last}">
                    ${hobby},
                </c:if>
                <c:if test="${s.last}">
                    ${hobby}
                </c:if>
            </c:forEach>
        </td>
        <td>
            <a href="${pageContext.request.contextPath}/remove.emp?id=${emp.id}" onclick="return confirm('确认是否删除')">删除</a>
        <a href="${pageContext.request.contextPath}/getEmpById.emp?id=${emp.id}">修改</a>
        </td>
    </tr>
    </c:forEach>
</table>
<span style="color: red">${listEmpMsg}</span>

</body>
</html>
